﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true" CodeBehind="Attendence.aspx.cs" Inherits="ESCHOOL.admin.WebForm18" Title="Attendence" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style3
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    
    
        <table style="width:100%">
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td colspan="2">
                    <asp:TextBox ID="tbdayid" runat="server" Visible="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Date</td>
                <td colspan="2">
                    <asp:TextBox ID="tbdate" runat="server" ReadOnly="True"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Class</td>
                <td colspan="2">
                    <asp:DropDownList ID="ddclass" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddclass_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Student</td>
                <td colspan="2">
                    <asp:DropDownList ID="ddstud" runat="server" AutoPostBack="True">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Attendence</td>
                <td colspan="2">
                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" 
                        Height="16px" RepeatDirection="Horizontal" Width="170px">
                        <asp:ListItem Value="p">P</asp:ListItem>
                        <asp:ListItem Value="a">A</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="labreason" runat="server" Text="Reason"></asp:Label>
                </td>
                <td colspan="2">
                    <asp:TextBox ID="tbreason" runat="server" TextMode="MultiLine">No</asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="tbreason" ErrorMessage="fill it"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lableave" runat="server" Text="Leave"></asp:Label>
                </td>
                <td colspan="2">
                    <asp:RadioButtonList ID="RadioButtonList2" runat="server" Height="23px" 
                        RepeatDirection="Horizontal" Width="134px">
                        <asp:ListItem Value="True">Yes</asp:ListItem>
                        <asp:ListItem Value="False">No</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btninsert" runat="server" onclick="btninsert_Click" 
                        Text="Insert" />
                </td>
                <td>
                    <asp:Button ID="btnupdate" runat="server" Text="Update" 
                        onclick="btnupdate_Click" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td colspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td colspan="2">
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnpresnt" runat="server" onclick="btnpresnt_Click" 
                        Text="Present" style="height: 26px" />
                </td>
                <td colspan="2">
                    <asp:Button ID="btnabsent" runat="server" onclick="btnabsent_Click" 
                        Text="Absent" />
   
                    <br />
                </td>
            </tr>
        </table>
        <br />
   
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                        onrowdeleting="GridView2_RowDeleting" 
            onrowediting="GridView2_RowEditing" 
            onpageindexchanging="GridView2_PageIndexChanging">
            <Columns>
                <asp:BoundField DataField="class_name" HeaderText="Class" />
                <asp:TemplateField HeaderText="Date">
                <ItemTemplate><%#Eval("date","{0:D}") %></ItemTemplate></asp:TemplateField>
                <asp:BoundField DataField="student_name" HeaderText="Student Name" />
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:Button ID="btnedit" runat="server" CommandArgument='<%# Eval("day_id") %>' 
                            CommandName="Edit" oncommand="btnedit_Command1" Text="Edit" 
                            CausesValidation="False" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:Button ID="btndelete" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' CommandName="Delete" 
                            oncommand="btndelete_Command1" Text="Delete" CausesValidation="False" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <p>
            &nbsp;</p>
   
        <asp:GridView ID="GridView1" runat="server" 
            onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
            AutoGenerateColumns="False" 
            onpageindexchanging="GridView1_PageIndexChanging">
            <Columns>
                <asp:BoundField DataField="class_name" HeaderText="Class" />
                <asp:TemplateField HeaderText="Date">
                <ItemTemplate><%#Eval("date","{0:D}") %></ItemTemplate></asp:TemplateField>
                <asp:BoundField DataField="student_name" HeaderText="Student" />
                <asp:BoundField DataField="reason" HeaderText="Reason" />
                <asp:BoundField DataField="leave" HeaderText="Leave" />
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:Button ID="btnedit" runat="server" CommandArgument='<%# Eval("day_id") %>' 
                            CommandName="Edit" oncommand="btnedit_Command" Text="Edit" 
                            CausesValidation="False" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:Button ID="btndelete" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' CommandName="Delete" 
                            oncommand="btndelete_Command" Text="Delete" CausesValidation="False" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <p>
            &nbsp;</p>
        <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
            onrowdeleting="GridView3_RowDeleting" onrowediting="GridView3_RowEditing" 
            onpageindexchanging="GridView3_PageIndexChanging">
            <Columns>
                <asp:BoundField DataField="class_name" HeaderText="Class" />
                <asp:TemplateField HeaderText="Date">
                <ItemTemplate><%#Eval("date","{0:D}") %></ItemTemplate></asp:TemplateField>
                <asp:BoundField DataField="student_name" HeaderText="Student" />
                <asp:BoundField DataField="reason" HeaderText="Reason" />
                <asp:BoundField DataField="leave" HeaderText="Leave" />
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:Button ID="btnedit" runat="server" CommandArgument='<%# Eval("day_id") %>' 
                            CommandName="Edit" oncommand="btnedit_Command2" Text="Edit" 
                            CausesValidation="False" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <asp:Button ID="btndelete" runat="server" 
                            CommandArgument='<%# Eval("day_id") %>' CommandName="Delete" 
                            oncommand="btndelete_Command2" Text="Delete" CausesValidation="False" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <p>
            &nbsp;</p>
        <p>
            &nbsp;</p>
        <p>
            &nbsp;</p>
            
    
</asp:Content>
